package cn.wei.sdd.core.controller.admin;


import cn.wei.common.result.R;
import cn.wei.sdd.core.pojo.query.InWarehouseQuery;
import cn.wei.sdd.core.pojo.vo.InWarehouseVO;
import cn.wei.sdd.core.service.InWarehouseService;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <p>
 * 入库表 前端控制器
 * </p>
 *
 * @author Wei
 * @since 2021-11-04
 */
@RestController
@Api(tags = "入库管理")
@RequestMapping("/admin/core/inWarehouse")
public class AdminInWarehouseController {
    @Resource
    private InWarehouseService inWarehouseService;

    @ApiOperation("入库记录列表")
    @GetMapping("inWarehouseList/{page}/{limit}")
    public R getInWarehouseListPage(
            @ApiParam(value = "当前页码",required = true)
            @PathVariable("page") Long page,
            @ApiParam(value = "每页记录数",required = true)
            @PathVariable("limit") Long limit,
            @ApiParam(value = "搜索对象",required = false)
            InWarehouseQuery inWarehouseQuery){
        Page<InWarehouseVO> pageParam = new Page<>(page,limit);
        IPage<InWarehouseVO> pageModel =  inWarehouseService.listPage(pageParam,inWarehouseQuery);

        return R.ok().data("pageModel",pageModel);

    }

}

